Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb] Fix TestGlobalModuleCache.py for remote debugging #111483

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

igorkudrin
Copy link
Collaborator

SBDebugger().Create() returns a debugger with only the host platform in its platform list. If the test suite is running for a remote platform, it should be explicitly added and selected in the new debugger created within the test, otherwise, the test will fail because the host platform may not be able to launch the built binary.

`SBDebugger().Create()` returns a debugger with only the host platform
in its platform list. If the test suite is running for a remote platform,
 it should be explicitly added and selected in the new debugger created
within the test, otherwise, the test will fail because the host platform
may not be able to launch the built binary.
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 8, 2024

@llvm/pr-subscribers-lldb

Author: Igor Kudrin (igorkudrin)

Changes

SBDebugger().Create() returns a debugger with only the host platform in its platform list. If the test suite is running for a remote platform, it should be explicitly added and selected in the new debugger created within the test, otherwise, the test will fail because the host platform may not be able to launch the built binary.


Full diff: https://github.com/llvm/llvm-project/pull/111483.diff

1 Files Affected:

  • (modified) lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py (+2)
diff --git a/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py b/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
index ccefc28946e062..16bc86bd4fc44d 100644
--- a/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
+++ b/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
@@ -111,6 +111,8 @@ def do_test(self, one_target, one_debugger):
         else:
             if one_target:
                 new_debugger = lldb.SBDebugger().Create()
+                if lldb.selected_platform is not None:
+                    new_debugger.SetSelectedPlatform(lldb.selected_platform)
                 new_debugger.SetAsync(False)
                 self.old_debugger = self.dbg
                 self.dbg = new_debugger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants